package com.funwell.server.base;

import com.alibaba.fastjson.annotation.JSONField;
import com.funwell.server.constants.SysModuleEnum;
import com.funwell.server.constants.SysUserTypeEnum;

import javax.persistence.Column;
import javax.xml.bind.ValidationException;
import java.util.Date;

/**
 * 基础类，所有的实体类必须基础此类
 * @author fulei
 *
 */
public class BaseEntity extends SimpleBaseEntity {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    
    @JSONField(serialize=false)
    public static SysModuleEnum getModule() throws ValidationException {
        throw new ValidationException("谁没有再model中重写getModule方法");
    }

    /**
     * 创建时间
     */
    @Column(name = "`create_time`")
    private Date createTime;

    /**
     * 创建人
     */
    @Column(name = "`creator_id`")
    private String creatorId;

    /**
     * 创建人类型
     */
    @Column(name = "`creator_type`")
    private SysUserTypeEnum creatorType;

    /**
     * 修改时间
     */
    @Column(name = "`modify_time`")
    private Date modifyTime;

    /**
     * 修改人
     */
    @Column(name = "`modifier_id`")
    private String modifierId;

    /**
     * 修改人类型
     */
    @Column(name = "`modifier_type`")
    private SysUserTypeEnum modifierType;

    public String getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    public SysUserTypeEnum getCreatorType() {
        return creatorType;
    }

    public void setCreatorType(SysUserTypeEnum creatorType) {
        this.creatorType = creatorType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getModifierId() {
        return modifierId;
    }

    public void setModifierId(String modifierId) {
        this.modifierId = modifierId;
    }

    public SysUserTypeEnum getModifierType() {
        return modifierType;
    }

    public void setModifierType(SysUserTypeEnum modifierType) {
        this.modifierType = modifierType;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
}